const a = {val:'a'}
const b = {val:'b'}
const c = {val:'c'}
const d = {val:'d'}

//使用object 模拟链表
a.next = b
b.next = c
c.next = d

//打印链表
let point = a
while(point){
    console.log(point.val);
    point = point.next
}

// 插入链表
e = {val:'e'}
c.next = e
e.next = d

console.log(a);


//删除链表
c.next = d